// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:54 +0800 CST
// path: app/model/module/post/post_entity.go
// author：jon
// ==========================================================================

package post

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id              int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	BlogId          int64     `json:"blog_id" xorm:"comment('博客id') bigint(20)"`
	UserId          int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	Title           string    `json:"title" xorm:"comment('标题') varchar(255)"`
	Content         string    `json:"content" xorm:"comment('内容') longtext"`
	ExtraData       string    `json:"extra_data" xorm:"comment('扩展数据') text"`
	CountView       int64     `json:"count_view" xorm:"comment('观看次数') bigint(20)"`
	CountComment    int64     `json:"count_comment" xorm:"comment('评论次数') bigint(20)"`
	CountLike       int64     `json:"count_like" xorm:"comment('赞同次数') bigint(20)"`
	CountFavor      int64     `json:"count_favor" xorm:"comment('收藏次数') bigint(20)"`
	CountReward     int64     `json:"count_reward" xorm:"comment('打赏次数') bigint(20)"`
	Status          int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime      time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime      time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
	LastCommentTime time.Time `json:"last_comment_time" xorm:"comment('最后评论时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	BlogId       int64  `form:"blogId" `
	UserId       int64  `form:"userId" `
	Title        string `form:"title" `
	Content      string `form:"content" `
	ExtraData    string `form:"extraData" `
	CountView    int64  `form:"countView" `
	CountComment int64  `form:"countComment" `
	CountLike    int64  `form:"countLike" `
	CountFavor   int64  `form:"countFavor" `
	CountReward  int64  `form:"countReward" `
	Status       int    `form:"status" binding:"required"`

	LastCommentTime time.Time `form:"lastCommentTime" `
}

//修改页面请求参数
type EditReq struct {
	Id              int64     `form:"id" binding:"required"`
	BlogId          int64     `form:"blogId" `
	UserId          int64     `form:"userId" `
	Title           string    `form:"title" `
	Content         string    `form:"content" `
	ExtraData       string    `form:"extraData" `
	CountView       int64     `form:"countView" `
	CountComment    int64     `form:"countComment" `
	CountLike       int64     `form:"countLike" `
	CountFavor      int64     `form:"countFavor" `
	CountReward     int64     `form:"countReward" `
	Status          int       `form:"status" binding:"required不能为空"`
	LastCommentTime time.Time `form:"lastCommentTime" `
}

//分页请求参数
type SelectPageReq struct {
	BlogId          int64     `form:"blogId"`          //博客id
	UserId          int64     `form:"userId"`          //用户id
	Title           string    `form:"title"`           //标题
	Content         string    `form:"content"`         //内容
	ExtraData       string    `form:"extraData"`       //扩展数据
	CountView       int64     `form:"countView"`       //观看次数
	CountComment    int64     `form:"countComment"`    //评论次数
	CountLike       int64     `form:"countLike"`       //赞同次数
	CountFavor      int64     `form:"countFavor"`      //收藏次数
	CountReward     int64     `form:"countReward"`     //打赏次数
	Status          int       `form:"status"`          //0未审核 1正常状态 2审核未通过 3删除
	LastCommentTime time.Time `form:"lastCommentTime"` //最后评论时间
	BeginTime       string    `form:"beginTime"`       //开始时间
	EndTime         string    `form:"endTime"`         //结束时间
	PageNum         int       `form:"pageNum"`         //当前页码
	PageSize        int       `form:"pageSize"`        //每页数
}
